package com.cango.framework.base.excption;

/**
 * <p>
 * ClassName: BaseException
 * </p>
 * <p>
 * Description: 异常基类
 * </p>
 * <p>
 * Author: weih
 * </p>
 * <p>
 * Date: 2014-5-20
 * </p>
 */
public class BaseException extends RuntimeException {
    /**
     * <p>
     * Field code: 异常代码
     * </p>
     */
    private Integer status;

    private String message;

    public BaseException() {

    }

    /**
     * 默认构造函数
     * 
     * @param code 异常代码
     * @param message 异常信息
     */
    public BaseException(Integer code, String message) {
        super(message);
        this.status = code;
    }

    public BaseException(String message) {
        super(message);
        this.message = message;
    }

    public BaseException(Integer code, String message, Throwable throwble) {
        super(message, throwble);
        this.status = code;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer code) {
        this.status = code;
    }

    public String getMessage() {
        return null == message ? super.getMessage() : message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
